﻿<%@ Page Title="Employee Time Sheet Listing" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="EmployeeTimeSheet-List.aspx.cs" Inherits="Employee_EmployeeTimeSheetList" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolKit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<title>Employee TimeSheet Listing</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="bodyContentTop" Runat="Server">
    <h1> Time Sheet List </h1>
    <h3></h3>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="bodyContent" Runat="Server">
    <div class="elements_inner_wrapper">
        <div id="contentBody">
            <div class="section">
                <div class="seperator">
                </div>
                <fieldset class="formouter">
                    <table>
                        <tr>
                            <td>
                                <div class="row_curved" id="divSchoolList" runat="server" title="Example:UCSM, MIT, YTU">
                                        <label for="<%=ddlSchoolList.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Selected School Name" ID="Label2" /></label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlSchoolList" OnSelectedIndexChanged="ddlSchoolList_SelectedIndexChanged"
                                                    DataTextField="ListText" DataValueField="ListValue" Height="23px" 
                                                    CssClass="inputBox_large" />
                                                <asp:RequiredFieldValidator ID="rfvSchoolList" ValidationGroup="StudentProfile" ControlToValidate="ddlSchoolList"
                                                    runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a school name.<br/>"></asp:RequiredFieldValidator>
                                                <br />
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                </div>     
                                <div class="row_curved" id="divFirstName" runat="server">
                                        <label for="<%=ddlEmployee.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Employee" ID="lblFirstName" Width="140px" /></label>
                                        <span class="indicator">
                                            <asp:DropDownList ID="ddlEmployee" runat="server" CssClass="inputBox_large">
                                            </asp:DropDownList>                                        
                                        </span>
                                        <div class="clear">
                                        </div>
                                </div>

                                <div class="row_curved" id="div1" runat="server">
                                        <label for="<%=txtStartDate.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="StartDate" ID="lblStartDate" Width="140px" /></label>
                                        <span class="indicator">
                                           <asp:TextBox ID="txtStartDate" runat="server" MaxLength="12" CssClass="inputBox_medium"></asp:TextBox>
                                           <asp:ImageButton runat="Server" ID="ibtnCalendar1" ImageUrl="~/images/Calendar.gif"
                                                AlternateText="Click to show calendar" ToolTip="Click to select calendar" CausesValidation="false" />
                                           <AjaxToolKit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtStartDate"
                                                Format="dd/MM/yyyy" PopupButtonID="ibtnCalendar1" PopupPosition="TopLeft" />
                                                                               
                                        </span>
                                        <div class="clear">
                                        </div>
                                </div>
                                <div class="row_curved" id="div2" runat="server">
                                        <label for="<%=txtEndDate.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="End Date" ID="lblEndDate"  /></label>
                                        <span class="indicator">
                                               <asp:TextBox ID="txtEndDate"  runat="server" MaxLength="12" CssClass="inputBox_medium"></asp:TextBox>
                                               <asp:ImageButton runat="Server" ID="ibtnCalendar2" ImageUrl="~/images/Calendar.gif"
                                                    AlternateText="Click to show calendar" ToolTip="Click to select calendar" CausesValidation="false" />
                                               <AjaxToolKit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtEndDate"
                                            Format="dd/MM/yyyy" PopupButtonID="ibtnCalendar2" PopupPosition="TopLeft" />                                                               
                                      </span>
                                     <div class="clear">
                                     </div>
                                </div>                                                        
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                                <asp:Button   runat="server" ID="btnShowEmployeeAttandance" Text="Search"   OnClick="btnShowEmployeeAttandance_Click" />&nbsp;&nbsp;
                                 <asp:Button   runat="server" ID="btnAddAttndance" Text="New  Attandance"   OnClick="btnAddAttndance_Click" />                      
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h2>
                                    Employees Time Sheet Listing</h2>
                                <asp:GridView ID="grvEmployeeAttandance" runat="server" AutoGenerateColumns="False" DataKeyNames="EmployeeTimeSheetKey"
                                    CellPadding="4" ForeColor="#333333" Width="100%" OnRowDeleting="grvEmployeeAttandance_RowDeleting" OnRowDataBound="grvEmployeeAttandance_OnRowDataBound"
                                    GridLines="None" OnSelectedIndexChanged="grvEmployeeAttandance_SelectedIndexChanged">
                                    <RowStyle BackColor="#EFF3FB" />
                                    <Columns>
                                        <asp:BoundField DataField="EmployeeTimeSheetKey" HeaderText="EmployeeTimeSheetKey" InsertVisible="False"
                                            ReadOnly="True" SortExpression="EmployeeTimeSheetKey" Visible="False" />
                                        <asp:BoundField DataField="UserAccountKey" HeaderText="ID" SortExpression="UserAccountKey"
                                            HeaderStyle-Width="5%" />
                                        <asp:BoundField DataField="Employee" HeaderText="Employee Name" SortExpression="Employee"
                                            HeaderStyle-Width="25%" />
                                        <asp:BoundField DataField="TimeIn" HeaderText="Time In" SortExpression="Time In"
                                            HeaderStyle-Width="35%" />
                                        <asp:BoundField DataField="TimeOut" HeaderText="Time Out" SortExpression="Time Out"
                                            HeaderStyle-Width="35%" />
                                        <asp:BoundField DataField="Remarks" HeaderText="Remarks" SortExpression="Remarks"
                                            HeaderStyle-Width="25%" />
                                        <asp:TemplateField HeaderText ="Status">
                                                <HeaderStyle Width="3%" />
                                                <ItemTemplate>
                                                        <asp:CheckBox ID="chkStatus"  runat="server" />
                                                </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="CreatedDateTime" HeaderText="CreatedDateTime" SortExpression="CreatedDateTime"
                                            HeaderStyle-Width="35%" Visible="False" />
                                        <asp:BoundField DataField="ModifiedDateTime" HeaderText="ModifiedDateTime" ReadOnly="True"
                                            HeaderStyle-Width="35%" SortExpression="ModifiedDateTime" />                                        
                                        <asp:HyperLinkField  Text="Edit Details" DataNavigateUrlFormatString="~/Employee/EmployeeTimeSheetEntry.aspx?id={0}&TimeSheetStatus={1}"
                                            DataNavigateUrlFields="EmployeeTimeSheetKey,TimeSheetStatus" Visible="true"  HeaderStyle-Width="35%" ItemStyle-Width="20%"/>
                                        <asp:CommandField ShowDeleteButton="True" ButtonType="Link" />
                                    </Columns>
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <EmptyDataTemplate>
                                        Please Add New Employee Attandance of Selected School.
                                    </EmptyDataTemplate>
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle BackColor="White" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div runat="server" id="divSelectedKeys" visible="false">
                                    <asp:Label runat="server" ID="lblSelectedEmployeeAttandanceKey" />
                                    <asp:Label runat="server" ID="lblSelectedEmployeeUserAccountKey" />
                                </div>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </div>
        </div>
    </div>
</asp:Content>
